package bean;

import java.sql.Connection;
import java.sql.DriverManager;

public class ConnectionBean {
	private static Connection con;
	private ConnectionBean(){}
	
	public static Connection getConnection()
	{
		try{
			if(con == null || con.isClosed())
			{
				Class.forName("com.mysql.jdbc.Driver");
				con=DriverManager.getConnection("jdbc:mysql://localhost:3306/sameermehrotra","root","admin");
			}
		}catch(Exception e)
		{
			e.printStackTrace();
		}
		return con;
	}
}
